package com.fxp.project.jiuselu.web.models.common.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fxp.project.jiuselu.web.models.common.entity.JslBackendConfig;
import com.fxp.project.jiuselu.web.models.common.mapper.JslBackendConfigMapper;
import com.fxp.project.jiuselu.web.models.common.service.IJslBackendConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 配置信息表 服务实现类
 * </p>
 *
 * @author M_
 * @since 2021-12-28
 */
@Service
public class JslBackendConfigServiceImpl extends ServiceImpl<JslBackendConfigMapper, JslBackendConfig> implements IJslBackendConfigService {

    @Autowired
    private JslBackendConfigMapper jslBackendConfigMapper;


    @Override
    public Map<String, String> getCommpanyMessage() {
        List<JslBackendConfig> commpanyMessageList = jslBackendConfigMapper.selectByIncType("commpany_message");
        Map<String, String> map = new HashMap<>();
        for (JslBackendConfig config : commpanyMessageList) {
            map.put(config.getName(), config.getValue());

        }
        return map;
    }
}
